package com.woniuxy.happylife.controller;

import com.woniuxy.happylife.entity.ResponseEntity;
import com.woniuxy.happylife.entity.User;
import com.woniuxy.happylife.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Classname personalController
 * @Description TODO
 * @Version 1.0.0
 * @Date 2022/2/19 9:57
 * @Created by hang
 */
@RestController
@RequestMapping("/personal")
public class personalController {
    @Resource
    UserService userService;
    //获取个人的信息
    @RequestMapping("/getUser")
    public ResponseEntity<List<User>> getUser(){
        List<User> user =userService.getUser();
        if (user== null){
            return new ResponseEntity<List<User>>(500,"查询user错误",user);
        }
        return new ResponseEntity<>(200,"查询user成功",user);
    }
}
